package edu.utd.text.game.designer.commands;

import java.util.ArrayList;

import edu.utd.text.game.designer.controller.DesignerController;
import edu.utd.text.game.domain.areas.Room;

public class ListRoomsCommand implements DesignerCommand {

	public String execute() throws Exception {
		ArrayList<Room> rooms = DesignerController.INSTANCE.getGameMap().getRooms();
		if (rooms.isEmpty()) {
			return "There are no rooms in the current game map yet.";
		}
		
		String roomListOnePerLine = "";
		for (Room room : rooms) {
			roomListOnePerLine += (room.getRoomName() + "\n");
		}
		return "Rooms currently in the game map:\n" + roomListOnePerLine;
	}

}
